/**
 * @format
 * @Author: TC
 * @Date: 2025-07-28 16:34:03
 * @Last Modified by: TC (tengchao@taqu.cn)
 * @Last Modified time: 2025-10-21 16:53:05
 */

import { gameMgr } from "db://assets/FrameWork/Manager/GameManager";
import { app } from "../../../../FrameWork/App";
import { MoleUIConfig } from "./Const/MoleUIConst";
import { MoleDataManager } from "./Manager/MoleDataManager";
import { MolePreloadManager } from "./Manager/MolePreloadManager";
import { MoleBattleManager } from "./Module/Battle/MoleBattleManger";
import { MoleCapManager } from "./Manager/MoleCapManager";
import { MoleBagManager } from "./Manager/MoleBagManager";

/**
 * 打地鼠游戏入口
 */
class GameMole {
    /**
     * 打地鼠
     */
    public start(): void {
        gameMgr.getCurrGameConfig().gameIns = this;
    }

    /**
     * 游戏数据
     */
    private _dataMgr: MoleDataManager;
    public get dataMgr(): MoleDataManager {
        return this._dataMgr || (this._dataMgr = new MoleDataManager());
    }
    /**
     * 预加载管理
     */
    private _preloadMgr: MolePreloadManager;
    public get preloadMgr(): MolePreloadManager {
        return this._preloadMgr || (this._preloadMgr = new MolePreloadManager());
    }
    /**
     * 战斗管理
     */
    private _battleMgr: MoleBattleManager;
    public get battleMgr(): MoleBattleManager {
        return this._battleMgr || (this._battleMgr = new MoleBattleManager());
    }
    /**
     * 帽子管理
     */
    private _capMgr: MoleCapManager;
    public get capMgr(): MoleCapManager {
        return this._capMgr || (this._capMgr = new MoleCapManager());
    }
    /**
     * 背包管理
     */
    private _bagMgr: MoleBagManager;
    public get bagMgr(): MoleBagManager {
        return this._bagMgr || (this._bagMgr = new MoleBagManager());
    }
    /**
     * 释放游戏管理
     */
    public release(): void {
        // this._battleMgr.release();
        // this._battleMgr = null;
        app.uiMgr.removeUICfg(MoleUIConfig);
    }
}
export const gameMole = new GameMole();
